import Vue from "vue";
import VueRouter from 'vue-router' 
Vue.use(VueRouter)

const routes=[
    {path:"/",redirect:"/login"},
    {path:"/login",component:()=>import("@/views/Login.vue")},
    {path:"/layout",component:()=>import("@/views/Layout.vue"),
     children:[
                {path:"",//默认显示这个组件
                 component:()=>import("@/views/Phone.vue"),
                 meta:{icon:"el-icon-phone",title:"通讯录"},
                 name:"phone"
                },
                {path:"addinfo",
                 component:()=>import("@/views/Addinfo.vue"),
                 meta:{icon:"el-icon-phone",title:"添加信息"},
                 name:"addinfo"
                },
                {path:"user",
                 component:()=>import("@/views/User.vue"),
                 meta:{icon:"el-icon-phone",title:"个人中心"},
                 name:"user"
                }
               ]
    },
]


let router= new VueRouter({routes,mode:"history"})
export default router